<?php
	/**
	 * Created by PhpStorm.
	 * User: 陈森
	 * Date: 2020/12/28
	 * Time: 21:39
	 */

	namespace app\admin\controller\schelist;


	use app\admin\model\scheduling\SchelistModel;
	use core\basic\Controller;

	class SchelistController extends Controller
	{

		protected $model;

		public function __construct()
		{

			$this->model = new SchelistModel();

		}

		public function index()
		{
			$this->display('schelist/list.html');
		}

		public function userList()
		{
			if ($_GET) {

				$field = get('key');
				if (!!($field = get('key', 'array')) && !!($keyword = $field['usermobile'])) {
					$res = $this->model->Schelist('u.usermobile', $keyword);
				}else{

					$count = $this->model->count();
					$res = $this->model->Schelist();
				}
				$data = array(
					'code' => 0,
					'msg' => '',
					'count' => $count,
					'data' => $res
				);

				return json_encode($data);
			}
		}

	}